a = 100
if a >= 0:  # 注释用井号 冒号代替括号
    print(a)
else:
    print(-a)

string = "I'm \"OK\"!"  # 字符串中双引号要转义
print(string)

string = 'I am chuchu'  # 字符串也可以使用单引号
print(string)

string = 'I\'am chuchu'  # 单引号也要转义
print(string)

String = "welcome to my home:\nchuchu"  # \n \t就代表换行，制表符 \n已经转义过了 \+字母就代表转义
print(String)  # Python对大小写敏感，大写和小写不同

string = "line1" \
         "line2" \
         "line3"
print(string)

# 布尔值
print(True)
print(False)
print(3 > 2)
print(1 == 2)

# 布尔值运算  and or not
flag = 3 > 2 and 1 == 2  # True & False
print("the flag is :", flag)

flag = 3 > 2 and 1 == 1
print("the flag is:", flag)

flag = 2 == 2 or 1 > 0
print("the flag is :", flag)

flag = 2 == 3 or 1 < 0
print("the flag is:", flag, "haha")

# and 相当于oc中的& 与
# or 相当于oc中的| 或
# not 相当于oc中的！ 非

flag = 2 > 3
if not flag:
    print("the result is not true")
else:
    print("the result is true")

flag = None
if not flag:  # flag == None
    print("flag is None")
print(flag)

# 动态语言不需要指定变量的类型 ，比如java和oc 必须int  a =10，否则会报错。python是动态语言，直接a=10 flag = true即可

x = 10
x = x + 2
print(x)
x += 2
print(x)

a = 'abv'
b = a
a = 'ddddd'  # 变量a的指针指向新的字符串。b还指向老字符串没有变化
print(b)

# python中用大写表示常量
import sys, os

BASE_DIR = sys.path[1]
print(BASE_DIR)
PI = 3.14

print(10 / 3)
print(9 / 3)
